package org.springside.examples.showcase.wb.web;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springside.examples.showcase.common.entity.Catalog;
import org.springside.examples.showcase.wb.service.WbContentManager;

@Controller
public class WbEventController {
	/**
	 * 列表框架页面，仅仅为了展示（Framset），具体逻辑交由具体的其他ajax
	 */
	@RequestMapping(value = "/wb/event")
	public String list() {
		return "wb/event";
	}

	/**
	 * 展示某地址的微博内容
	 * 
	 * @param nedAnalyzedUrl 微博url
	 * @return json格式的微博内容
	 */
	@RequestMapping(value = "/json/event")
	@ResponseBody
	public List<Catalog> detail() {
		List<Catalog> catalogs = new ArrayList<Catalog>();
		Catalog c1 = new Catalog();
		c1.setName("rule1");
		catalogs.add(c1);
		Catalog c2 = new Catalog();
		c2.setName("<规则2>;");
		catalogs.add(c2);
		return catalogs;
	}

	@Autowired
	private WbContentManager wbContentManager;
}
